# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=simplyemail
pkgver=1.4.10.r7.6a42d37
pkgrel=4
epoch=1
pkgdesc='Email recon made fast and easy, with a framework to build on CyberSyndicates.'
groups=('blackarch' 'blackarch-recon')
url='https://github.com/killswitch-GUI/SimplyEmail'
license=('GPL2')
arch=('any')
depends=('python2' 'python2-requests' 'python2-pdfminer' 'python2-docx2txt'
         'python2-beautifulsoup4' 'python2-xlsx2csv' 'python2-lxml'
         'python2-mechanize' 'python2-beautifulsoup3' 'python2-fake-useragent'
         'python2-magic' 'python2-configparser' 'antiword' 'odt2txt' 'wget'
         'python2-dnspython')
makedepends=('git')
source=("$pkgname::git+https://github.com/killswitch-GUI/SimplyEmail.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags |
  sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g;s/\.rc./rc/g;s/Version\.//g'
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 SimplyEmail.py "\$@"
EOF

  chmod 755 "$pkgdir/usr/bin/$pkgname"
}

